<template>
  <div>
		<SkuForm
			:source-attribute="sourceAttribute"
			:structure="structure"
			:attribute.sync="attribute"
			:sku.sync="sku"
		/>
		<el-row type="flex" :gutter="20">
			<el-col>
				<el-divider content-position="left">attribute 数据</el-divider>
				<pre><code>{{ attribute }}</code></pre>
			</el-col>
			<el-col>
				<el-divider content-position="left">sku 数据</el-divider>
				<pre><code>{{ sku }}</code></pre>
			</el-col>
		</el-row>
	</div>
</template>
<script>
import SkuForm from 'vue-sku-form'
export default {
  components: {
		SkuForm
	},
  data(){
    return{
       sourceAttribute: [
				{
					name: '颜色',
					item: ['黑', '金', '白']
				},
				{
					name: '内存',
					item: ['16G', '32G']
				},
				{
					name: '重量',
					item: ['111', '222']
				},
				{
					name: '当时v',
					item: ['谁谁谁', '谁谁谁1']
				}
			],
			structure: [
				{
					name: 'originalprice',
					type: 'input',
					label: '原价'
				},
				{
					name: 'price',
					type: 'input',
					label: '现价'
				},
				{
					name: 'stock',
					type: 'input',
					label: '库存'
				},
				{
					name: 'stock',
					type: 'input',
					label: '库存'
				},
				{
					name: 'stock',
					type: 'input',
					label: '库存'
				},
				{
					name: 'stock',
					type: 'input',
					label: '库存'
				},
				{
					name: 'stock',
					type: 'input',
					label: '库存'
				}
			],
			attribute: [],
			sku: []
    }
  }
}
</script>
<style scoped>
</style>
